<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>免邮专区</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="admin.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="../module/inventory/css/admin/index.css" />
<script type="text/javascript" src="../script/jquery-1.4.4.min.js"></script>
<script>
//保存价格
	function savePrice(snsId,type){
		if(snsId>0){
			if(type=='fee'){
				var price = $('#freeFee_'+snsId).val();
				var act = 'saveFee';
			}else{
				var price = $('#freePrice_'+snsId).val();
				var act = 'savePrice';
			}
			$.post('<{$config.weburl}>/admin/module.php?m=activity&s=free_shipping_express.php',{"id":snsId,"free_shipping_price":price,"act":act},function(s){
				window.location.reload();
			});
		}
	}

$(function(){
	//改变状态
	$('.changeStatus').click(function(){
		var status = $(this).attr('statusV');
		var id = $(this).attr('dataId');
		if(id>0){
			$.post('<{$config.weburl}>/admin/module.php?m=activity&s=free_shipping_express.php',{"id":id,"status":status,"act":"changeStatus"},function(s){
				window.location.reload();
			});
		}
	});
});
</script>
</head>
<body>
	<div class="container">
        <div class="flow">
            <div class="itemtitle">
                <h3>免邮专区</h3>
                <ul>
                    <li class="current"><a href="?m=activity&s=free_shipping_express.php"><span>管理</span></a></li>
                </ul>
            </div>
        </div>
        <div class="h35"></div>  
        
    <form action="" method="get">
    <input type="hidden" name="m" value="activity">
    <input type="hidden" name="s" value="free_shipping_express.php">
    <table class="select_table">
        <tbody>
            <tr>
            	<td width="50">仓库:</td>
            	<td width="100">
	                <select name="stock_shop" id="stock_shop" >
	                <option value="" <{if $general_shop!=0}>disabled<{/if}>>全部</option>
	                <{foreach item=list from=$stock_shops}>
	                	<option value="<{$list.id}>" <{if $smarty.get.stock_shop==$list.id}>selected<{/if}> <{if $general_shop!=0&&$general_shop!=$list.id}>disabled<{/if}>><{$list.title}></option>
	                <{/foreach}>
	                </select>
                </td>

                <td width="60">状态：</td> 
                <td width="80">
                	<select name="status" id="status">
                		<option value="">全部</option>
                		<option value="1" <{if "1"===$smarty.get.status}>selected="selected"<{/if}>>开启</option>
                		<option value="0" <{if "0"==$smarty.get.status}>selected="selected"<{/if}>>关闭</option>
                	</select>
                </td>
                <td><input type="image" src="<{$config.weburl}>/image/admin/search.gif" /></td>
            </tr>
            
        </tbody>
    </table>
    </form>

        <table class="table">
        	<thead>
                <tr>
                    <th class="partition" colspan="99">快递列表</th>
                </tr>
            </thead>
            <tbody>
                <tr class="header">
                    <th width="50">ID</th>
                    <th width="100">仓库</th>
                    <th width="150">快递名称</th>
                    <th width="170">产品数量</th>
                    <th width="170">起免金额</th>
                    <th width="170">减免金额</th>
                    <th width="60">状态</th>
                    
                    <th width="100">操作</th>
                </tr>
                <{foreach item=list from=$de.list}>
                <tr>
                    <td><{$list.id}></td>
                    <td><{$list.shop_name}></td>
                    <td><{$list.express_name}></td>
                    <td><{$list.product_num}></td>
                    <td><{$config.money}><input type="text" id="freePrice_<{$list.id}>" onblur="savePrice(<{$list.id}>);" value="<{$list.free_shipping_price}>"/></td>
                    <td><{$config.money}><input type="text" id="freeFee_<{$list.id}>" onblur="savePrice(<{$list.id}>,'fee');" value="<{$list.free_fee}>"/></td>
                    <td><{if $list.status==1}><button class="changeStatus" statusV='0' dataId='<{$list.id}>'>开启</button><{else}><button class="changeStatus" statusV='1' dataId='<{$list.id}>'>关闭</button><{/if}></td>
                    <td>
                    	<a href='?m=activity&s=free_shipping_product.php&editid=<{$list.id}><{$cond}>'><{$setimg}></a>
                    </td>
                </tr>
                <{foreachelse}>
                <tr>
                    <td class="norecord" colspan="99"><i></i><span>暂无符合条件的数据记录</span></td>
                </tr>
                <{/foreach}>
            </tbody>
            <tfoot>
                <tr>
                	<td colspan="99">
                    	<div class="page"><{$de.page}></div>
                    </td>
                </tr>
            </tfoot>
        </table>
    </div>
</body>
</html>